Ext.onReady(function() {
	format = 'image/png';

	var layer1 = new OpenLayers.Layer.WMS(
			"World Map"
		,	"http://maps.opengeo.org/geowebcache/service/wms"
		,	{
					layers: "bluemarble"
				,	version: "1.0.0"
				, transparent: "true"
				, format: "image/png"
				,	allowOpacity: false
				,	allowDelete: false
			}
	);
	var Pasall = new OpenLayers.Layer.MapServer( 
			"PAall","http://bioval.jrc.ec.europa.eu/cgi-bin/mapserv?&map=/srv/www/htdocs/PA/Customized_mapfile.map&layer=PAall_w_color&pa=-1&mode=map"
		,	{layers:['PAall_w_color'],transparent: 'true'}
		,	{singleTile: true, ratio:1,transitionEffect:"resize" }
		,	{'displayInLayerSwitcher':false
	});
	
	var geoMapPanel = new GBIF.GeoSpatial.MapComponent({
				height:400
			,	zoom:2
			,	layers: [layer1, Pasall]
			,	renderTo:'map'
	});
	geoMapPanel.map.events.register('click', this,function(e){

		document.getElementById('nodelist').innerHTML = "Loading... please wait...";

        var params = {
                        REQUEST: "GetFeatureInfo",
                        EXCEPTIONS: "application/vnd.ogc.se_xml",
                        BBOX: '-90,-90,0,0',                  //geoMapPanel.map.getExtent().toBBOX(),
                        X: e.xy.x,
                        Y: e.xy.y,
                        INFO_FORMAT: 'text/html',
                        QUERY_LAYERS: 'gbif:pyramid_2',       //geoMapPanel.map.layers[0].params.LAYERS,
                        FEATURE_COUNT: 50,
                        Srs: 'EPSG:4326',
                        Layers: 'gbif:pyramid_2',
                        Styles: '',
                        WIDTH: '512',            //geoMapPanel.map.size.w,
                        HEIGHT: '512',           //geoMapPanel.map.size.h,
                        format: format,
		};

		
		OpenLayers.loadURL("http://ogc.gbif.org:80/wms", params, this, setHTML, setHTML);
        OpenLayers.Event.stop(e);
//http://ogc.gbif.org/wms?service=WMS&version=1.1.0&request=GetMap&layers=gbif:pyramid_2&styles=&bbox=-90.00000000000145,-89.9999999999971,-2.8990143619012088E-12,1.4495071809506044E-12&width=512&height=512&srs=EPSG:4326&format=application/openlayers
/*
		var url =  Pasall.getFullRequestString({
            	REQUEST: "GetFeatureInfo"
            ,	EXCEPTIONS: "application/vnd.ogc.se_xml"
            ,	BBOX: Pasall.map.getExtent().toBBOX()
            ,	X: e.xy.x
            ,	Y: e.xy.y
            ,	INFO_FORMAT: 'text/html'
            ,	QUERY_LAYERS: Pasall.params.LAYERS
            ,	REDIUS:2
            ,	WIDTH: Pasall.map.size.w
            ,	HEIGHT: Pasall.map.size.h
		});
        OpenLayers.loadURL(url, '', this, setHTML);
        Event.stop(e);
*/		
	});
 
	function setHTML(response) {
        document.getElementById('nodelist').innerHTML = response.responseText;
    };

})